// ** Third Party Components
import axios from 'axios'
import { FileText } from 'react-feather'
import { UncontrolledTooltip } from 'reactstrap'

export let data

// ** Get initial Data
data = [
  {
    id: '100',
    name: 'BOX007(192.168.1.100)',
    status: {
      value: 1,
      label: '在线',
    },
    quality: '31',
    SIM: '898604A4102190034436',
    onlineRate: '100%',
    equipName: 'BOX007(192.168.1.100)',
    equip: 'simeon01',
  },
  {
    id: '101',
    name: 'BOX087(192.168.10.100)',
    status: {
      value: 1,
      label: '在线',
    },
    quality: '29',
    SIM: '898604A4102190034436',
    onlineRate: '100%',
    equipName: 'BOX007(192.168.1.100)',
    equip: 'S7-200',
  },
]

const statusEnum = {
  0: '#ea5455',
  1: '#56affd',
}
// ** Table Common Column
export const columns = [
  {
    name: '服务ID',
    minWidth: '100px',
    cell: (row) => row.id,
  },
  {
    name: '服务名称',
    minWidth: '150px',
    selector: (row) => row.name,
  },
  {
    name: '状态',
    minWidth: '150px',
    cell: (row) => (
      <span
        style={{
          color: statusEnum[row.status.value],
          border: `1px solid ${statusEnum[row.status.value]}`,
          borderRadius: '4px',
          padding: '1px 4px',
        }}
      >
        {row.status.label}
      </span>
    ),
  },
  {
    name: '信号质量',
    minWidth: '150px',
    selector: (row) => row.quality,
  },
  {
    name: 'SIM卡号',
    minWidth: '150px',
    selector: (row) => row.SIM,
  },

  {
    name: '近一个月在线率',
    minWidth: '150px',
    selector: (row) => row.onlineRate,
  },
  {
    name: '关联设备',
    minWidth: '150px',
    selector: (row) => row.equip,
  },
]
